import { Control, controlsUtils } from "fabric";
import FabricImg from "../myFabric/FabricImg";

class CropRContorls extends Control {
    constructor(options) {
        super(options);
    }

    icon: FabricImg;

    x = 0.5;
    y = 0;
    cursorStyle = 'ew-resize';

    actionHandler = controlsUtils.scalingX;

    render(ctx, left, top, styleOverride, fabricObject) {
        if (this.icon) {
            this.icon.set({
                originX: "center",
                originY: "center",
                left,
                top,
            });
            this.icon.render(ctx);
        }
    }
}

const cropRContorls = new CropRContorls({});

export default cropRContorls;